/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lianxishilili.demo;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;

/**
 *
 * @author Administrator
 */
public class OutputsDemo {
    public static void main(String[] args) throws FileNotFoundException {
        File file=new File("c:\\","text.txt");
        FileOutputStream f=new FileOutputStream(file,true);
        PrintWriter p=new PrintWriter(f,true);
        p.println("hello");
        System.out.println("已经成功向文件中添加了一行数据");
        
    }

}
